package com.zjitc.service;

import com.zjitc.mapper.UserMapper;
import com.zjitc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserMapper userMapper;


    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public User getUserId(int id) {
        return userMapper.getUserId(id);
    }

    @Override
    public List<User> getUserPage(int offset, int pageSize) {
        return userMapper.getUserPage(offset, pageSize);
    }

    @Override
    public int pageCount() {
        return userMapper.pageCount();
    }

    @Override
    public int countByKeyword(String keyword) {
        return userMapper.countByKeyword(keyword);
    }

    @Override
    public List<User> search(String keyword, int offset, int pageSize) {
        return userMapper.search(keyword, offset, pageSize);
    }
}
